<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

//Route::middleware('auth:api')->get('/user', function (Request $request) {
//    return $request->user();
//});

//注册登录
Route::post('login', 'ApiController@login');

//获取小程序openid
Route::post('getOpenid','ApiController@getOpenid');
Route::any('test1','IndexController@test');
//解密小程序获取的电话
Route::post('getPhoneNumber','ApiController@getPhoneNumber');


/*************回调******************/
//    购买vip回调
Route::any('vip/callback', 'CallbackController@vipCallback');
//    结算回调
Route::any('settle/callback', 'CallbackController@settleCallback');

Route::group(['middleware' => 'api.refresh'], function () {
    /************公用***************/
    //    图片上传
    Route::post('uploadImg', 'PublicController@uploadImg');
    //    店铺图片识别
    Route::post('storeImgDistinguish', 'PublicController@storeImgDistinguish');
    //    任务详情（商户用户公用）
    Route::post('getOneSub', 'StoreController@getOneSub');

    Route::post('test', 'ApiController@test');

    //修改用户电话
    Route::post('editUserPhone', 'UsersController@editUserPhone');

    /************首页************/
//    首页banner，广告，会员广告
    Route::get('index', 'IndexController@index');
//    首页任务列表
    Route::post('getSub', 'StoreController@getSub');

    /*************用户位置**************/
//    获取列表
    Route::get('getAddress', 'UserAddressController@getList');
//    获取单个
    Route::get('getOneAddress/{id}', 'UserAddressController@getOne')->where('id', '[0-9]+');
//    删除单个
    Route::get('delAddress/{id}', 'UserAddressController@delOne')->where('id', '[0-9]+');
//    修改或添加
    Route::post('saveAddress', 'UserAddressController@save');

    /*******商户********/
//    立即入驻
    Route::post('settleIn', 'StoreController@settleIn');
//    获取当前用户的店铺信息
    Route::post('getStoreInfo', 'StoreController@getInfo');
    //获取某个店铺信息
    Route::post('getInfoById', 'StoreController@getInfoById');
//    获取当前用户的店铺列表
    Route::post('getStoreInfoList', 'StoreController@getStoreInfoList');
//    获取当前商户的首页统计数据
    Route::post('getStoreStatistics', 'StoreController@getStoreStatistics');
//    获取运营品类
    Route::post('getCate', 'StoreController@getCate');
//    获取当前服务费配置
    Route::post('getServiceFee', 'StoreController@getServiceFee');
//    更新用户的店铺信息
    Route::post('saveStore', 'StoreController@save');
//    删除店铺
    Route::post('deleteStore', 'StoreController@deleteStore');
//    添加/更新 任务
    Route::post('saveSub', 'StoreController@saveSub');
//    批量添加时间
   Route::post('addDaySub', 'StoreController@addDaySub');
//    终止任务
    Route::post('overSub', 'StoreController@overSub');
//    删除任务
    Route::post('delSub', 'StoreController@delSub');
//    任务列表
    Route::post('getSubList', 'StoreController@getList');
//    订单列表
    Route::post('merchantOrderList', 'UserOrderController@merchantOrderList');
//    标记订单通过
    Route::post('auditOk', 'UserOrderController@auditOk');
//    订单驳回
    Route::post('auditFail', 'UserOrderController@auditFail');
//    结算
    Route::post('settlement', 'PaymentController@settlement');

    /************我的***************/
    //    我的
    Route::post('getUser', 'UsersController@getUser');
    //    我的邀请
    Route::post('myInvite', 'UsersController@myInvite');
    //    领取vip
    Route::post('receiveVip', 'UsersController@receiveVip');
    //    订单满5领取vip
    Route::post('userFiveOrderLot', 'UsersController@userFiveOrderLot');
    //    开通vip
    Route::post('openVip', 'PaymentController@openVip');
    //    提现
    Route::post('withdrawal', 'PaymentController@withdrawal');
    //    购买vip
    Route::post('openVip', 'PaymentController@openVip');
    //    提现列表
    Route::post('withdrawalList', 'UsersController@withdrawalList');
    //    切换用户当前版本端状态
    Route::post('setUserCurrentType', 'UsersController@setUserCurrentType');
    //    添加formid
    Route::post('addFormid', 'UsersController@addFormid');

    /*************我的订单********************/
    //订单列表
    Route::post('orderList', 'UserOrderController@orderList');
    //订单详情
    Route::post('orderDetail', 'UserOrderController@orderDetail');
//    创建订单
    Route::post('createOrder', 'UserOrderController@createOrder');
//    取消订单
    Route::post('cancelOrder', 'UserOrderController@cancelOrder');
//    提交初审
    Route::post('auditFirst', 'UserOrderController@auditFirst');
//    提交复审
    Route::post('auditSecond', 'UserOrderController@auditSecond');
//    检查当前任务最新订单状态
    Route::post('checkSubOrder', 'UserOrderController@checkSubOrder');

    /***********天天领钱*************/
//    领钱首页（包含签到）
    Route::post('everyDayReceive', 'UsersController@everyDayReceive');
//    领签到奖品
    Route::post('receiveLot', 'UsersController@receiveLot');
//    参与打卡
    Route::post('joinMeals', 'UsersController@joinMeals');
//    打卡签到
    Route::post('signMeals', 'UsersController@signMeals');
//    饭点实时额度
    Route::post('mealAmount', 'UsersController@mealAmount');
//    领取邀请品鉴金
    Route::post('receiveInviteLot', 'UsersController@receiveInviteLot');


});

